

class MyArray<T> {  //注释1
    public Object[] array = new Object[10];
    public T getPos(int pos) {
        return (T)this.array[pos];
    }
    public void setVal(int pos,T val) {
        this.array[pos] = val;
    }
}
public class TestDemo {
    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<>();//注释2
        myArray.setVal(0,10);
        myArray.setVal(1,12);
        int ret = myArray.getPos(1);//注释3
        System.out.println(ret);
        myArray.setVal(2,"bit");//注释4
    }
}
